package com.erp.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;

/**
 * 
 * @TableName t_customer
 */
@TableName(value ="t_customer")
@Data
public class Customer implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 
     */

    @NotBlank(message = "客户名称不能为空")
    @Length(min = 3, max = 10, message = "客户名称长度必须在3到10个字符之间")
    private String custName;

    /**
     * 
     */
    @NotBlank(message = "地址不能为空")
    private String address;

    /**
     * 
     */
    @NotBlank(message = "电话不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "电话号码格式不正确")
    private String phone;

    /**
     * 
     */
    @NotBlank(message = "客户类型不能为空")
    private String custType;

    /**
     * 
     */
    private Integer grade;

    /**
     * 
     */
    private Double hisTotal;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}